#ifndef CGRABWIDGET_H
#define CGRABWIDGET_H


#include <qwidget.h>
#include <QMouseEvent>
#include <qpainter.h>
class CGrabWidget:public QWidget{
    Q_OBJECT
public:
    CGrabWidget(QWidget*parent=0);
signals:
    void sGrab(const QRect&rect);
protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void paintEvent(QPaintEvent *e);
private:
    QPoint pDown,pLast;
    bool isDown;

};


#endif // CGRABWIDGET_H
